home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / lib / printd.pro < prev    next >
Text File  |  1997-07-08  |  979b  |  47 lines

  1. ; $Id: printd.pro,v 1.3 1997/01/15 03:11:50 ali Exp $
  2. ;
  3. ; Copyright (c) 1989-1997, Research Systems, Inc.  All rights reserved.
  4. ;       Unauthorized reproduction prohibited.
  5.  
  6. ;+
  7. ; NAME:
  8. ;    PRINTD
  9. ;
  10. ; PURPOSE:
  11. ;    Display the contents of the directory stack maintained by the
  12. ;    PUSHD and POPD User Library procedures.
  13. ;
  14. ; CALLING SEQUENCE:
  15. ;    PRINTD
  16. ;
  17. ; OUTPUTS:
  18. ;    PRINTD lists the contents of the directory stack on the default
  19. ;    output device.
  20. ;
  21. ; COMMON BLOCKS:
  22. ;    DIR_STACK:  Contains the stack.
  23. ;
  24. ; MODIFICATION HISTORY:
  25. ;    17, July, 1989, Written by AB, RSI.
  26. ;-
  27. ;
  28. ;
  29. pro printd
  30.  
  31. COMMON DIR_STACK, DEPTH, STACK
  32.  
  33. on_error,2                      ;Return to caller if an error occurs
  34. if (n_elements(DEPTH) eq 0) then depth = 0
  35.  
  36. CD, CURRENT=current
  37. print, 'Current Directory: ', current
  38.  
  39. if (DEPTH eq 0) then begin
  40.   message, 'Directory stack is empty.'
  41. endif else begin
  42.   print, 'Directory Stack Contents:'
  43.   for i = 0, DEPTH-1 do print,format='(I3,") ", A)', I, STACK[I]
  44. endelse
  45.  
  46. end
  47.